module App::View
    class DropWindow < KDE::MainWindow
        attr_reader :tv
        attr_reader :reload_button, :togglweb_button

        def initialize(geo)
            super()

            tv = App::View::TogglTreeBrief.new
            @tv = tv

            toolbar = Qt::ToolBar.new
            toolbar.setIconSize Qt::Size.new(16,16)
            @reload_button = toolbar.addAction KDE::Icon.new("mail-receive"), "Reload"
            @togglweb_button = toolbar.addAction KDE::Icon.new("start-here"), "Toggl Web"
            addToolBar Qt::BottomToolBarArea, toolbar

            setCentralWidget tv

            # "Skip taskbar" needed to keep it on desktop under 'show desktop'.
            #  Unfortunately no Korundum binding, yet.
            #  You should set "skip taskbar" in CCSM as a workaround.
            # KWin::setState( winId(), NET::SkipTaskbar || NET::SkipPager )
            # Qt::WindowStaysOnTopHint
            setWindowFlags(
                Qt::Tool |
                Qt::FramelessWindowHint
            )

            setGeometry geo.toRect if geo

            show
        end
    end
end
